package com.hongying.producer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class FanoutSender {


    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String exchange,String routingKey,String message){
        log.info("Exchange:{},-routingKey:{}-Message:{}",exchange,routingKey,message);
        this.rabbitTemplate.convertAndSend(exchange,routingKey,message);

    }


}
